import http from '../util/request.js'

export default {
    captcha:()=>{
        return http({
            url:'/api/login/captcha',
            method:'get'
        });
    },
    login: (obj) => {
        return http({
            url: '/api/login/dologin',
            method: 'post',
            //表单参数
            params: obj
        })
    },
    logininfo: () => {
        return http({
            url: '/api/login/logininfo',
            method: 'get'
        })
    },
    updatePassword:(passwords)=>{
        return http({
            url:'/api/login/updatePassword',
            method:'put',
            data:passwords,
            headers:{
                'Content-Type':'application/json'
            }
        })
    },
    // 发送验证码接口
    sendVerificationCode: (email) => {
        return http({
            url: '/api/login/sendCode',
            method: 'post',
            params: { email: email },
            skipAuth:true//跳过认证
        })
    },
    // 重置密码接口
    resetPassword: (data) => {
        return http({
            url: '/api/login/reset-password',
            method: 'post',
            data: data,
            headers: {
                'Content-Type': 'application/json'
            },
            skipAuth:true//跳过认证
        })
    }
}